#include <asm.h>
#include <regdef.h>
#include <new_inst_test.h>

LEAF(my5_maddu_test)
    .set noreorder
    addiu s0, s0 ,1
    addiu s2, zero, 0x0
    lui   t2, 0x1
###test inst
    LI (t0,0x2222);
    LI (t1,0x3333);
    LI (t2,0x4444);
    LI (t3,0x5555);
    maddu t0,t1;
    maddu t1,t2;
    maddu t2,t3;
    TEST_MType(0x9474ba99,0x643c9869,0x27383d12,0xaafb8fef,0x74b0dc51,0xd5176bb6,maddu)
    TEST_MType(0x238e1f29,0x3d1b58ba,0xecfcfdbc,0x8e99ffd9,0x2eb141f2,0x861d561d,maddu)
    TEST_MType(0xaea0ff84,0xeddff7ac,0x7099e595,0x1753aa75,0xfde9dce5,0x1190cde7,maddu)
    TEST_MType(0xebf1f08a,0x109cf92e,0x6c6434ff,0xbd0b0e29,0x7fdcc233,0xbe583b37,maddu)
    TEST_MType(0xb195049a,0x519b500d,0xda11a1a1,0xc18f6285,0xc0d245cf,0xda8ecf5d,maddu)
    TEST_MType(0x436c6125,0x333ab105,0xc5ee2311,0xa61a8829,0x2443a858,0x989c7ba2,maddu)
    TEST_MType(0xf7124255,0xbcac2f33,0x77525b54,0x744c4954,0xe7658965,0x71f32454,maddu)
    TEST_MType(0xf7c93bf2,0x3a95f874,0x0f9b8ec9,0x719a5598,0x1e7ff521,0x737b8ddc,maddu)
    TEST_MType(0x22221a70,0x3006c83e,0xc924a961,0x4a72fa70,0x419ac241,0x440badfc,maddu)
    TEST_MType(0x3804823e,0x7724c67e,0x0d48549a,0xc8275131,0xdb9c4616,0xae152c95,maddu)
    TEST_MType(0xa7f42871,0xc7aaa7a4,0x26b25c78,0x30aec5b4,0x95dcbd14,0x1d4ed43b,maddu)
    TEST_MType(0x2cd89a32,0x859272c4,0x60e1c85c,0xb24a15b1,0xabdd7614,0xc7bc8025,maddu)
    TEST_MType(0xcd0006fe,0x579478fe,0x8863bf09,0x74eb8f9f,0xc23dbf05,0x865e2156,maddu)
    TEST_MType(0x12e685fb,0xadf1122f,0x1eba4f10,0x9555576f,0xb0b10ffb,0x9b644884,maddu)
    TEST_MType(0xc6c79a8b,0x180115be,0xd196a6b3,0x105827c4,0x47398c89,0x15b5af5c,maddu)
    TEST_MType(0x0d34b6a8,0x3f6ab60f,0xb78e7b89,0x5ae15f1c,0x7e0c57b1,0x579be4f1,maddu)
    TEST_MType(0x5ff87e05,0xda58f409,0x1661b716,0x0563f86d,0x4ad084e9,0x1381823a,maddu)
    TEST_MType(0x100f8fca,0xeafeb535,0xabd8c81a,0x0567ebd7,0x098a3148,0x06b94764,maddu)
    TEST_MType(0x168e121f,0x99e1c0e2,0x3f4c867a,0x48da7ff6,0x540a471c,0x51d9c564,maddu)
    TEST_MType(0x0bf72b14,0x42963e5a,0x7ffeae66,0x3e2c9251,0x08f2b15e,0x3b0fd379,maddu)
    TEST_MType(0xb69d7ec5,0xf95a119c,0x6ba68afb,0x8ffdced1,0x800035ef,0x8e15eef7,maddu)
    TEST_MType(0x80481f56,0x90922654,0x0ad4ae1d,0x839c30fc,0xff77a1e5,0x4c04a8af,maddu)
    TEST_MType(0x14e17e33,0x8b21f11d,0xc8e3250f,0xac4cf2f9,0x2df6d648,0xb5d53ceb,maddu)
    TEST_MType(0x57fc4fbb,0x43f18422,0xef9d2790,0x61343b4b,0x26f324ba,0x49da307d,maddu)
    TEST_MType(0x5fb8370b,0xfb7753e6,0x831e9461,0x6e155fe5,0x6aa78f7f,0x6fc75af8,maddu)
    TEST_MType(0x82a1e708,0x73a1821b,0x8d111823,0xb262bb95,0xaaa3aa4b,0xeb0318b2,maddu)
    TEST_MType(0x8e36ed68,0xacd666c8,0xa303b3b9,0xcb48c418,0x5092ca79,0xa65215c3,maddu)
    TEST_MType(0x2a155dbc,0x097e1b4e,0xee8e2942,0x42eda3b8,0x1ca0c5fa,0x415e286c,maddu)
    TEST_MType(0xdc279554,0x5c10fe21,0xf02a062a,0x7a3c6e38,0xc3a66e56,0x872095ab,maddu)
    TEST_MType(0xd4f27242,0x379e21b5,0x56ba336f,0x614d35df,0xd3d8e8c5,0x6aa7b75c,maddu)
    TEST_MType(0xa98a00ca,0x3db012b3,0x9147145c,0x9b9286db,0xa4da531e,0xb0681c1c,maddu)
    TEST_MType(0xcb0294b1,0x56438d15,0x47006488,0x3c1c10ba,0xd391b503,0x4df72e4e,maddu)
    TEST_MType(0xa27775f8,0xa139502c,0xf37e4c2a,0xcf06f433,0x75e0858a,0xac6639ac,maddu)
    TEST_MType(0xbbd8f966,0x2157f6bc,0x02d639da,0xe8e1458b,0xa82d0ef2,0xf1c1b858,maddu)
    TEST_MType(0x49d0feac,0xaaae460d,0x99744e08,0x1197c0df,0x634c574c,0x2a31b62d,maddu)
    TEST_MType(0x820062f7,0x96180c1b,0xd3ecfcd1,0xaed49ec8,0x1816f8c4,0x7ab49daf,maddu)
    TEST_MType(0x9e18b15d,0x0f819e7f,0x4d72fb76,0x72c7c7ae,0xcede9853,0x78b5e776,maddu)
    TEST_MType(0x91acb322,0x9a6973e4,0x192c43fe,0xb7589054,0xd9f273b6,0x8b90d1d0,maddu)
    TEST_MType(0x3fc32e20,0xeb2ac97b,0x6493c365,0xbf765d64,0x91557a05,0xc4a6b7f9,maddu)
    TEST_MType(0xc083d00c,0x17180b0b,0x279a1664,0x47788cd5,0xa2dfa1e0,0x4d32ab86,maddu)
    TEST_MType(0x6b47f63e,0xe9307f0f,0xd5cfde7b,0x0822a7d0,0x3fcfaed9,0x11b1cc33,maddu)
    TEST_MType(0xd66cb967,0x744939a3,0xb1fe27a9,0xad9e01ce,0x6b1d2c14,0xc080a227,maddu)
    TEST_MType(0xcd86b009,0xb2102060,0x17b7a250,0x1d2bc15c,0xeca47ef0,0x0dcdf8f6,maddu)
    TEST_MType(0x2e8a6394,0xd5952642,0x6ce6f76c,0xad97704e,0xc94d5344,0xb54d9188,maddu)
    TEST_MType(0x5451cf49,0x3e6400e6,0xf6fce3c6,0x56d13a4d,0x8ef8a830,0x424479da,maddu)
    TEST_MType(0xb8a1da96,0x95c48eb4,0x612b00c9,0xc041e213,0x1f461b51,0xa2a4544d,maddu)
    TEST_MType(0x7e0f6384,0x8d1cbec6,0xb6c7a313,0x632aa852,0x3494b2fb,0x9bbd6a67,maddu)
    TEST_MType(0x25973e32,0x913627bc,0x0fcc561d,0x6dffedae,0xf9b50b65,0x7e448de9,maddu)
    TEST_MType(0x1afe3625,0x6ebe4208,0x6a9edf3f,0x324d7744,0xf341a417,0x26a02c5e,maddu)
    TEST_MType(0x986f90a0,0xf9682d2e,0x9c0e8990,0xaa14d81d,0x3a966cd0,0xa76a0a06,maddu)


    TEST_MType(0x530194f0, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x5a1a4f60, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x5cc4e136, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0xab7a14c0, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x44d126d0, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x0f114ff0, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x60bfe48e, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x102ceba0, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x7b21e54d, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x5d72f954, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x2699b2d4, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x66b6dc30, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x00000000, 0x4ae569a0, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x00000000, 0x2582c9c0, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x00000000, 0xa2f01d2e, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x00000000, 0x2c5300d7, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x00000000, 0x7a95fab0, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x00000000, 0xf415d1b4, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x00000000, 0x0caf7d5c, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x00000000, 0xae15e524, 0x00000001, 0x00000001,0x1,0x1,maddu)
    TEST_MType(0x00000000, 0x00000000, 0x00000001, 0x00000001,0x1,0x1,maddu)
###detect exception
    bne s2, zero, inst_error
    nop
###score ++
    addiu s3, s3, 1
###output (s0<<24)|s3
inst_error:
    sll t1, s0, 24
    or t0, t1, s3
    sw t0, 0(s1)
    jr ra
    nop
END(my5_maddu_test)
